#include "addfrienditem.h"
#include "ui_addfrienditem.h"

AddFriendItem::AddFriendItem(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::AddFriendItem)
{
    ui->setupUi(this);
}

AddFriendItem::~AddFriendItem()
{
    delete ui;
}

void AddFriendItem::on_pushButton_add_clicked()
{
    Message message;
    message.setType("friend_request");
    message.setToId(m_userId);

    emit signal_friendRequest(message);
}

QString AddFriendItem::userId() const
{
    return m_userId;
}

void AddFriendItem::setUserId(const QString &newUserId)
{
    m_userId = newUserId;
}

QString AddFriendItem::username() const
{
    return m_username;
}

void AddFriendItem::setUsername(const QString &newUsername)
{
    ui->label_username->setText(newUsername);
    m_username = newUsername;
}

